package top.heliming.youyou.item.api;

import java.util.List;
import java.util.Map;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import top.heliming.youyou.item.pojo.SpecGroup;
import top.heliming.youyou.item.pojo.SpecParam;

/**
 * description: //TODO
 *
 * @author: heliming
 * @date:2019/06/02 上午 9:07
 */
@RequestMapping("spec")
public interface SpecificationApi {
  @GetMapping("groups/{cid}")
  public ResponseEntity<List<SpecGroup>> querySpecGroups(@PathVariable("cid") Long cid);

  @GetMapping("/params")
  public List<SpecParam> querySpecParam(
      @RequestParam(value = "gid", required = false) Long gid,
      @RequestParam(value = "cid", required = false) Long cid,
      @RequestParam(value = "searching", required = false) Boolean searching,
      @RequestParam(value = "generic", required = false) Boolean generic);


  // 查询规格参数组，及组内参数
  @GetMapping("{cid}")
  List<SpecGroup> querySpecsByCid(@PathVariable("cid") Long cid);

}
